package com.lzy.thread.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class GlobalEnv {

    public final String env;

    @Autowired
    public GlobalEnv(@Value("${profile-env:dev}") String env) {
        this.env = env.toLowerCase();
    }

    public boolean isProd() {
        return "prod".equals(env);
    }

    public boolean isDev() {
        return "dev".equals(env);
    }
}
